package com.hong.chapter1;

public class LoaderClass {
    public static void main(String[] args) {
        MyObject myobject1 = new MyObject();
        MyObject myobject2 = new MyObject();
        MyObject myobject3 = new MyObject();
        MyObject myobject4 = new MyObject();
        MyObject myobject5 = new MyObject();

        System.out.println(myobject1.getClass()==myobject2.getClass());
        System.out.println(myobject2.getClass()==myobject3.getClass());
        System.out.println(myobject4.getClass()==myobject5.getClass());
        System.out.println(MyObject.x);

        System.out.println(Sub.x);
    }

}

class MyObject {
    public static int x  = 10;

    static {
        System.out.println(x);
        x = 10 +1;

      /*  y= 200;

        System.out.println(y);*/



    }
    //    private  static  int y = 20;

}

class  Parent{

    static {
        System.out.println("parent");
    }
}

class Sub extends Parent{

    public static int x =100;

    static {
        System.out.println("child");
    }
}
